<?php

require_once("common.inc.php");
require_once("db.inc.php");
require_once("queries.inc.php");

auth();
$dbh = get_db();

initSession();

xmlhead("Woorden overhoren");

$languages = getLanguages();

$query = mysql_query(
"SELECT count(*) num, e.language_id, versus_language_id, shelf, test_mode
FROM wvt_wordguesses wg, uw_syntrans s, uw_expression e
WHERE s.syntrans_sid = wg.syntrans_sid
AND s.expression_id = e.expression_id
AND e.remove_transaction_id IS NULL
AND s.remove_transaction_id IS NULL
AND user_id = {$_SESSION['user_id']}
GROUP BY test_mode, language_id, versus_language_id, shelf
ORDER BY test_mode, language_id, versus_language_id, shelf
", $dbh
) or die (mysql_error());

?>

<table border="1">
<th>test mode<th>learn<th>versus<th>shelf<th>size

<?php

while ($row = mysql_fetch_array($query)) {
	echo "<tr><td>{$row['test_mode']}<td>{$languages[$row['language_id']]}<td>{$languages[$row['versus_language_id']]}<td>{$row['shelf']}<td>{$row['num']}\n";
}

?>

</table>
</body>
</html>